#include<bits/stdc++.h>

using namespace std;

int main() {
    int N;
    cin >> N;

    while (N--) {
        int m;
        cin >> m;
        int s = m * (m + 1) * (m + 2) / 6;
        cout << s << endl;
    }

    return 0;
}
